//
//  utils.h
//  remote-execute
//
//  Created by  AbbyCin on 11/1/14.
//  Copyright (c) 2014  AbbyCin. All rights reserved.
//

#ifndef remote_execute_utils_h
#define remote_execute_utils_h

#include "Header.h"
#include "sock_act.h"
#include <sys/mman.h>       /* mmap */

#define MAX_LIST 100 		/* limit of page's file and dir links */

void do_cgi(int sockfd, char *cmd);

void parse(char *url);

char *do_parse(const char *buf);

void do_resolve(char filetype[], const char path[]);

void *mymmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset);

void sock_writen(int fd, void *filebuf, size_t n);

int make_list(char *dir, char **res);

void show_links(int sockfd, char **res, char *dir, int num);

void do_trans(int sockfd, const char *path);

#endif
